home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / xconq / Doc / period.ms < prev    next >
Text File  |  1995-05-09  |  41KB  |  776 lines

  1. ./" SCO SCCS ID: @(#) period.ms 12.1 95/05/09 
  2. .SH
  3. PERIODS
  4. .LP
  5. Historical periods are the most complicated way to customize xconq,
  6. and can be difficult to get right.
  7. There are many hundreds of numbers,
  8. each of which must be in balance with every other.  At best, a mistake will
  9. result in a period whose winning strategies are quite simple;  at worst,
  10. \fIxconq\fP will hang or core dump.
  11. (\fIxconq\fP will make some efforts to check the numbers.)
  12. Although most historical periods are defined 
  13. in the period sections of mapfiles,
  14. one period is compiled into \fIxconq\fP
  15. (usually a version of WW II, since it is most familiar).
  16. Compiling other periods (using the utility \fIper2c\fP) is straightforward,
  17. and there is no problem with making unusual default periods for the
  18. program, but in practice, periods do not take very long to read.
  19. .LP
  20. The header of the period section has the form
  21. .IP
  22. \fBPeriod \fIextension\fR
  23. .LP
  24. where \fIextension\fP is the currently-unused extension flag.
  25. .LP
  26. The remainder of the description is in a postfix language similar
  27. to Forth or Postscript(tm), but even simpler.
  28. \fIxconq\fP includes an interpreter
  29. for this language, and program execution results in a filled-in period
  30. description.  There is a compiler, called \fIper2c\fP; it is used
  31. to produce a C version of the period definition which is then
  32. compiled into \fIxconq\fP.
  33. .LP
  34. The objects of this language are quite simple.  There are only integers,
  35. strings, and vectors of integers.  Integers and strings have direct
  36. representation as tokens, as do symbols, while integer vectors must be
  37. constructed using square brackets or one of the predefined vector-returning
  38. words.  Tokens are always separated by whitespace, which means whitespace
  39. may \fInever\fP be part of a token (backslash may be used for this purpose
  40. at some future date).
  41. Thus, the syntax for a token is fairly simple:
  42. .IP
  43. token -> [+-]*[0-9][0-9]*[%]* | "[~"]*" | [~"+\-0-9].*
  44. .LP
  45. In other words,
  46. numbers are digits optionally preceded by +/- and followed by %,
  47. while strings are anything enclosed in double quotes, and symbols are
  48. anything else that is not white space.  A semicolon is the comment character;
  49. the characters from the semicolon to the end of the line are discarded.
  50. Numbers are limited to the typical range for signed shorts; -32768 to 32767.
  51. The percent sign % is just for readability (since many numbers are
  52. percentages), and its presence or omission has no effect on anything.
  53. .LP
  54. Numbers and strings merely get pushed on the stack, while symbols are
  55. assumed to be defined words.  The reader looks them up in the dictionary
  56. and executes the associated C function, if one is defined (otherwise, the
  57. symbol gets pushed).  Nearly all words take a fixed number of arguments
  58. from the stack and push nothing, although there are some exceptions.
  59. The program is terminated by the word \fBend\fP.
  60. .LP
  61. Integer vectors are useful for filling in large parts of arrays.
  62. They are individual objects, built using the words \fB[\fP and \fB]\fP.
  63. .LP
  64. Usage of these depends on the word, but typically words with two or more
  65. arguments may include two vectors among them.  For instance, the line
  66. .IP
  67. \fB [ 1 1 2 8 ]  [ i a b B ]  hp \fP
  68. .LP
  69. sets the hit points for four types of units;
  70. \fB1\fP for unit type \fBi\fP, \fB8\fP for unit type \fBB\fP, and so forth.
  71. .LP
  72. The words below generally follow some extremely regular patterns.
  73. Most one-argument words define things for the entire period.
  74. Most two-argument words define attributes of units or resources, and
  75. may be thought of one-dimensional array operations, while three-argument
  76. words usually fill in two-dimensional arrays.
  77. In the two-argument and
  78. three-argument cases, the first argument (deepest in the stack) is the
  79. value, while second and third arguments are indices.
  80. At present, there are no words with four or more arguments.
  81. .LP
  82. One-dimensional operations allow three cases of the four possibilities for
  83. vectors and scalars: scalar value and index(set), 
  84. scalar value/vector index (fill), vector value and index (mapping).
  85. Two-dimensional operations offer six of the eight possible combinations
  86. (encoded here with S for scalar and V for vector,
  87. in the order value,index,index),
  88. disallowing only a vector value with either two scalar or two vector
  89. indices (VSS and VVV), since these combinations are not very meaningful.
  90. The six other combinations are SSS (element set), SVS and SSV (row fill),
  91. SVV (array fill), VVS and VSV (row mapping).  All of these combinations
  92. are useful - see existing periods for examples of their use.
  93. .LP
  94. The following descriptions cover all the predefined words of the period
  95. language.  Most words correspond to period attributes, and
  96. thus have an associated default value; when not explicitly mentioned, the
  97. default is \fB0\fP.
  98. For arguments of type \fIbool\fP, both \fB1\fP and \fB0\fP or \fBtrue\fP
  99. and \fBfalse\fP are valid (an argument characterized as \fIbool\fP may
  100. still be a vector of 1s and 0s).  Arguments of type \fIn\fP, \fIn%\fP,
  101. and \fIn.01%\fP are all just integers.
  102. .LP
  103. First, there are some useful words not specific to period
  104. definition.
  105. .IP \fBtrue\fR 5
  106. .IP \fBfalse\fR 5
  107. Pushes a \fB1\fP and a \fB0\fP on the stack, respectively.
  108. .IP \fB[\fR 5
  109. Marks the beginning of a vector.  The following objects must all evaluate
  110. to numbers only.
  111. .IP \fB]\fR 5
  112. Marks the end of a vector.  All numbers going back to the last \fB[\fP
  113. are popped and collected into a vector, which is pushed back on the stack.
  114. .IP \fIvalue\ name\ \fBdefine\fR 5
  115. Define the string \fIname\fP to be a word
  116. that pushes the object \fIvalue\fP onto the
  117. stack.  This is especially useful for assigning names to vectors, for
  118. instance a vector of all cities or all ships.
  119. .IP \fBprint\fP 5
  120. Print the current contents of the stack onto standard output, surrounded
  121. by /* */.  Very useful for debugging!
  122. .LP
  123. The global period definition words.
  124. .IP \fIstring\ \fBperiod-name\fR 5
  125. Defines the name of the period that will be displayed on startup.
  126. Defaults to \fB"unspecified"\fP.
  127. .IP \fIstring\ \fBfont-name\fR 5
  128. Defines the name of the font that will be used.  This is not needed
  129. if bitmaps are being used instead.  Defaults to the name of the text font.
  130. See below for a discussion of bitmaps and fonts.
  131. .IP \fIn\ \fBscale\fR 5
  132. Set the default scale of maps used with this period, in km.
  133. Defaults to \fB100\fP.
  134. (This value is unimportant, used only to compare with the map scale).
  135. .LP
  136. The words to define new kinds of units, resources, and terrain all add
  137. new words that push the number of their unit,
  138. resource, or terrain type onto the stack.  The numbering is in order;
  139. the first of each type will be numbered \fB0\fP.  Most of the period
  140. definition words use these values as indices when filling up arrays
  141. of numbers.
  142. .IP \fIchar\ name\ string\ \fButype\fR 5
  143. Define a type of unit.
  144. The arguments are unit character (a string of length one),
  145. full name, and a
  146. one-line help string.  The unit may thereafter be referred to by either
  147. its character (as a one-char symbol) or by its name.
  148. Things will not work if a blank or any other special characters (such as plus
  149. and minus signs) are used as a unit character.  Mixing terrain characters
  150. and unit characters is also a bad idea, since both may be used by a
  151. graphical display.
  152. At present, up to 30 or so unit types may be defined.
  153. .IP \fIchar\ name\ help\ \fBrtype\fR 5
  154. Define a type of resource, by both name and character, and supply a help
  155. string for it.  The characters must be distinct from unit characters,
  156. otherwise this word is identical to \fButype\fP.
  157. .IP \fIchar\ name\ color\ \fBttype\fR 5
  158. Define a type of terrain.  Unlike the other two definers, the terrain
  159. character does \fInot\fP become a new word, although the name still does.
  160. The character should be defined in the basic \fIxconq\fP font (the one named
  161. \fBxconq.onx\fP, in the X10 interface), if the
  162. period is to be used with an interface that needs it (monochrome X only,
  163. at this writing).  The color may be either approximate ("brown") or exact
  164. ("#334455"), but in any case, the interpretation is up to the interface.
  165. .IP \fBu*\fR 5
  166. Push a vector of all unit types in order.
  167. .IP \fBr*\fR 5
  168. Push a vector of all resource types in order.
  169. .IP \fBt*\fR 5
  170. Push a vector of all terrain types in order.
  171. .IP \fBnothing\fR 5
  172. Push the index of a non-unit onto the stack.  This word cannot be used for
  173. unit attributes, but it is useful for certain attributes whose values are
  174. unit types (\fBfirst-unit\fP, \fBfirst-product\fP).
  175. Use of this as an index with any word that sets unit attributes is
  176. guaranteed to cause nasty coredumps...
  177. .IP \fIstring\ unit\ \fBicon-name\fR 5
  178. Set the name of the icon for the given unit type.  If undefined, then
  179. the unit's character will be used in whichever font is being used for
  180. unit icons (which may even be the text font - works but not too attractive).
  181. Definition of an icon overrides any character in any font.
  182. As with the terrain, the exact interpretation of this word is up to
  183. the graphics interface - for instance, the curses interface ignores
  184. both the \fBfont-name\fP and \fBicon-name\fP words entirely.
  185. In X, the name is the name of a file in the usual bitmap format, as
  186. produced by the \fIbitmap\fP program.  The actual file name is produced
  187. by appending \fB".b"\fP for X10 bitmaps and \fB".b11"\fP
  188. for X11 bitmaps.  The X11 interface will also look for X10 bitmap files.
  189. .IP \fIterrain\ \fBdefault-terrain\fR 5
  190. Set the type of terrain to be substituted while reading a map
  191. with incomprehensible terrain characters.  Occasionally useful,
  192. if the set of terrain types is a subset of the standard set.
  193. .LP
  194. Initialization characteristics of a period are used only during synthesis
  195. of maps, sides, and units,
  196. which happens when they are not supplied from a mapfile.
  197. Periods that are used only with complete scenarios
  198. need not use any of these words.
  199. .IP \fIn%\ terrain\ \fBmin-alt\fR 5
  200. Set the minimum percentile of terrain elevations that result in the given
  201. terrain type.  Together with the other three words following, it is possible
  202. to subdivide all the possible altitudes and moisture levels into different
  203. kinds of terrain.  For instance, desert in the standard period ranges from
  204. sea level (\fB70 desert min-alt\fP)
  205. to high elevations (\fB93 desert max-alt\fP) but only
  206. in the lowest percentiles of moisture (\fB0 desert min-wet\fP,
  207. \fB20 desert max-wet\fP).  It is important that all percentiles be assigned
  208. to some terrain type, or the map generator will complain; when designing
  209. terrain combinations, it is helpful to make a graph with altitude percentiles
  210. 0-100 on one axis and moisture percentiles on the other.
  211. .IP \fIn%\ terrain\ \fBmax-alt\fR 5
  212. As for \fBmin-alt\fP, but set the maximum altitude percentile.
  213. Defaults to \fB100\fP.
  214. .IP \fIn%\ terrain\ \fBmin-wet\fR 5
  215. .IP \fIn%\ terrain\ \fBmax-wet\fR 5
  216. Set the minimum and maximum percentiles
  217. of world moisture levels that result in the given
  218. terrain type.  Deserts should range in the low percentiles (0-20), while
  219. rain forests should be high (90-100).
  220. The minimum defaults to \fB0\fP, while the maximum is \fB100\fP.
  221. .IP \fIn%\ \fBalt-roughness\fR 5
  222. Set a rather mysterious number that controls whether a random map tends
  223. toward large continents or archipelagos of small islands.  It must range
  224. between \fB0\fP and \fB100\fP.  Altitude roughness of \fB0\fP will result
  225. in a map with one large continent, while \fB100\fP produces dozens of tiny
  226. random islands, and drastic altitude variations from one hex to the next.
  227. Defaults to \fB80\fP.
  228. .IP \fIn%\ \fBwet-roughness\fR 5
  229. Set the "moisture roughness", which is like altitude roughness, but affects
  230. the distribution of wet and dry areas.  Defaults to \fB70\fP.
  231. .IP \fIterrain\ \fBedge-terrain\fR 5
  232. Set the type of terrain to fill in on the northern and southern edges of
  233. a map.  Best user-friendliness is to have a type that is scarce elsewhere,
  234. so the edges are not mistaken for normal terrain.
  235. .IP \fIdistance\ \fBcountry-size\fR 5
  236. Set the radius of a randomly-placed country, in hexes.
  237. The country is always hexagonal in shape, and the center hex is not counted
  238. in the radius.  The radius should be sufficient to accommodate all the
  239. initial units, without crowding them.  For radius r, the number of hexes
  240. is 3/4*(2r+1)**2.  Keep in mind that terrain may reduce
  241. the number of available hexes even further.
  242. If one type of unit can occupy another, then they are free to be placed in
  243. the same hex.
  244. Defaults to \fB3\fP.
  245. .IP \fIdistance\ \fBcountry-min-distance\fR 5
  246. .IP \fIdistance\ \fBcountry-max-distance\fR 5
  247. Set the minimum and maximum
  248. distances of country centers from each other, in hexes.
  249. These values are sometimes tricky to set properly.
  250. If too small, countries will mostly overlap;
  251. if too large, then attempts to use
  252. small maps will fail; if too close to each other, placements can also fail.
  253. Default to \fB7\fP and \fB60\fP hexes, respectively.
  254. .IP \fIunit\ \fBfirst-unit\fR 5
  255. Set the type of unit that player will be started off in.
  256. Setting this to \fBnothing\fP has the effect of giving every unit in
  257. the country to the player at the outset.  Production will not be
  258. set automatically, so this is not recommended for novices, who tend
  259. to find large numbers of units confusing at the outset.
  260. Defaults to \fBnothing\fP.
  261. .IP \fIunit\ \fBfirst-product\fR 5
  262. Set the type of unit that will be built automatically first.
  263. A "cheap" (quick to build) type is usually best,
  264. although interesting situations could result from, say, the
  265. automatic production of one atomic bomb at the outset (note that all sides
  266. start out in exactly the same way).
  267. Defaults to \fBnothing\fP.
  268. .IP \fIn\ unit\ \fBin-country\fR 5
  269. Set the number of units of the given type in a player's country.  These
  270. units are randomly scattered, with some bias towards the middle of the
  271. country, and subject to terrain limitations via the \fBfavored\fP parameter
  272. (see below).
  273. .IP \fIn\ unit\ \fBdensity\fR 5
  274. Set the total number of units appearing throughout the map, at the rate
  275. of one per ten thousand hexes.  The numbers of units appearing in countries
  276. is subtracted first,
  277. so that the final density of units is independent of the
  278. number of players.  If this value is nonzero, then at least one unit will
  279. appear on the map, even if the map is very small (i.e. the calculation of
  280. numbers rounds up not down).  Units not assigned to countries to meet 
  281. the quota set by \fBin-country\fP always become neutral.
  282. .IP \fIbool\ unit\ \fBnamed\fR 5
  283. Set a type of unit to get a random name during initialization.  The
  284. names are usually the names of towns,
  285. so this flag should be used judiciously
  286. (A battleship named "Wankers Corner" is only briefly amusing!).
  287. The value can also be set to \fB2\fP, in which case the unit name
  288. will be displayed by itself, without side name or unit type name.
  289. .IP \fIname\ \fBuname\fR 5
  290. Define the string \fIname\fP to be a plausible name for random assignment
  291. to an initial named unit.  The name will be included with any previously
  292. defined, including possibly ones in the compiled-in period.
  293. This behavior, which is unlike any other period word except for \fBsname\fP,
  294. is intended to ensure that each period need not define its own list of
  295. names.
  296. .IP \fBclear-unit-names\fR 5
  297. Reset the list of unit names.  This is appropriate if the compiled-in list
  298. is completely wrong for the period.
  299. .IP \fIn%\ terrain\ unit\ \fBfavored\fR 5
  300. Set the probability of the unit being on the given type of terrain at the
  301. outset.  The default of \fB0\fP is an absolute prohibition against placing
  302. the unit on that type of terrain, thus every period must specify at least
  303. one non-zero value for some terrain type and some initial unit type.
  304. (Note that this does not preclude a unit type with no favored terrain,
  305. but it must be able to occupy some other unit already placed.  In fact,
  306. this is a useful way to force one initial unit to start out inside another.)
  307. .IP
  308. This parameter is tricky to use properly, and not very flexible.  The problem
  309. is a widely differing favored terrains for initial units may be too
  310. constraining to work with the typical random map.  For instance, very few
  311. small countries will include both ice and open sea, or deserts and forests
  312. and swamps.  Failure to find such combinations will result in games exiting
  313. while still initializing, thus frustrating erstwhile players of the period.
  314. Best results will be had if the favored terrains are the same for all initial
  315. types of units, and the terrain types are common on random maps.
  316. (At present, the most-favored, or the lowest-numbered type among
  317. equally-favored terrains should be plentiful on the map;
  318. this is to get around a bug.)
  319. .IP \fIn\ \fBknown-radius\fR 5
  320. Set the area of the world known about, in those cases where the world is not
  321. already known.  \fIn\fP is measured in hexes,
  322. and represents a radius which will be seen around each of the starting units.
  323. .IP \fIbool\ unit\ \fBalready-seen\fR 5
  324. Set the type of unit that is or is not seen at the outset.
  325. This should usually be true of things like cities, independently of their
  326. \fBalways-seen\fP setting.
  327. .IP \fIn%\ resource\ unit\ \fBstockpile\fR 5
  328. Set the percentage of capacity for the given resource that each unit will
  329. start out with.  Defaults to \fB100\fP.
  330. .IP \fIname\ \fBsname\fR 5
  331. Declare the string \fIname\fP to be a plausible name for random assignment
  332. to a side.  The name will be added to the others already defined, including
  333. ones from the compiled-in period.
  334. .IP \fBclear-side-names\fR 5
  335. Reset the list of side names.  This is appropriate if the compiled-in list
  336. is completely wrong for the period, but if used, you must supply at least
  337. as many side names as there are possible sides (7 or so).
  338. .IP \fIn\ terrain\ \fBinhabitants\fR
  339. Set the number of inhabitants in each hex of a country with the given type
  340. of terrain.  The number is relative, and at present is only treated as a
  341. boolean value.
  342. .IP \fIn\ terrain\ \fBindependence\fR
  343. Set the "independence" of the inhabitants in the given type of terrain;
  344. how they react to enemy units in terms in attrition, supply, etc. [NIY]
  345. .LP
  346. The first phase in a turn is devoted to spying.  This is the revealing of
  347. all or part of a side's unit positions to another randomly-selected side.
  348. It is controlled by only two parameters.
  349. .IP \fIn%\ \fBspy-chance\fR 5
  350. Set the percentage chance of spying occurring on this turn.  If the chance
  351. is low, then the player doing the spying will get a message, otherwise the
  352. display will be silently updated.  The player spied upon is never informed.
  353. Defaults to \fB1\fP.
  354. .IP \fIn%\ \fBspy-quality\fR 5
  355. Set the percentage of enemy units that will be seen when spying is
  356. successful.  Defaults to \fB50\fP (i.e. on the average about half of the
  357. side's units will be seen).
  358. .LP
  359. The second phase in a turn determines any revolts or surrenders, attrition,
  360. and disasters.  Since these are (usually) rare events, the probabilities
  361. are set in one-hundredth percent increments.  Revolts happen anywhere, while
  362. surrender happens only if enemy units are nearby.  Attrition is the loss
  363. of single hit points, without actually destroying a unit, while disaster
  364. is the complete destruction of the unit (both of these depend on terrain).
  365. .LP
  366. Note that
  367. with 100 units in play, the lowest possible nonzero chance of 1 for a value
  368. still results in an occurence of that sort of
  369. disaster every 100 turns or so, so these parameters require a "light touch".
  370. .IP \fIn.01%\ unit\ \fBrevolt\fR 5
  371. Set the base chance for the unit to revolt spontaneously in that turn.
  372. This chance is reduced by better morale and maybe other things.
  373. .IP \fIn.01%\ unit\ \fBsurrender\fR 5
  374. Set the base chance for surrender to some adjacent enemy unit.
  375. Each enemy unit present adds to the chance by this amount.
  376. .IP \fIn.01%\ unit\ \fBsiege\fR 5
  377. Set the additional chance for surrender when the unit is completely
  378. surrounded by enemy units.  This is added to the basic surrender chance.
  379. .IP \fIn.01%\ terrain\ unit\ \fBattrition\fR 5
  380. Set the chance of a unit losing a single hit point while in the given
  381. terrain.
  382. .IP \fIn\ unit\ \fBattrition-damage\fR 5
  383. Number of hit points lost when attrition happens.  Defaults to \fB1\fP.
  384. Note that repair is in the following phase, and 1 hp of attrition damage
  385. might be repaired immediately, and appear not to have happened.
  386. .IP \fIstring\ unit\ \fBattrition-message\fR 5
  387. Set what to say when unit is hit by attrition.
  388. Defaults to \fB"suffers attrition"\fP.
  389. If the string is \fB""\fP, then the message will be suppressed entirely.
  390. .IP \fIn.01%\ terrain\ unit\ \fBdisaster\fR 5
  391. Set the chance of completely losing the unit while in the given terrain.
  392. Accidents should be restricted to definite hazardous situations, to go along
  393. with movement constraints - for instance, carriers in shallow water should
  394. move more slowly and have a nonzero accident rate.
  395. See random movement for another way to achieve similar effects.
  396. .IP \fIstring\ unit\ \fBdisaster-message\fR 5
  397. Set what to say when unit is lost in a disaster.
  398. Defaults to \fB"has met with disaster"\fP.
  399. .LP
  400. The next phase of a turn handles creation of new units and repair of damaged
  401. units.
  402. Units can only be created by certain other
  403. kinds of units, limited both by time and raw materials.  Also there are
  404. startup and research times.
  405. .IP \fIn\ unit2\ unit\ \fBmake\fR 5
  406. Set the time in turns needed for a unit of type \fIunit\fP
  407. to build one unit of type \fIunit2\fP,
  408. assuming sufficient resources to do so.
  409. .IP \fIbool\ unit\ \fBmaker\fR 5
  410. Set the unit type to be a "maker".  Makers always build unless
  411. explicitly idled, and may move while building.  If a period starts with
  412. no movers, then it needs at least one maker in the country, who will prompt
  413. for a unit type at the beginning of a game.
  414. .IP \fIn%\ unit\ \fBstartup\fR 5
  415. Set the extra time needed to build the first unit, if the maker was
  416. producing something else before.  Startup time should be higher for
  417. high-tech or large units, for instance to represent tooling or production
  418. pipeline startup.
  419. .IP \fIn%\ unit\ \fBresearch\fR 5
  420. Set the extra time needed for a side to build the very first unit of
  421. that type.  This time is in addition to the startup time for the first unit.
  422. Long research time is a good way to keep a unit type out of play for awhile.
  423. .IP \fIn\ resource\ unit\ \fBto-make\fR 5
  424. Set the total amount of a resource type needed to build a unit.
  425. This amount is amortized over the normal construction schedule, which
  426. means that extra resources are consumed by startup or research times
  427. (representing mistakes and experiments).
  428. .IP \fIn\ unit2\ unit\ \fBrepair\fR 5
  429. Set the time needed for the unit type \fIunit\fP
  430. to repair one hit point of damage to unit type \fIunit2\fP.
  431. One of the two units must be able to occupy the other;
  432. It is also legitimate for a unit to repair itself.
  433. Resources used to build units are also used
  434. at the same rate to accomplish repairs.
  435. .LP
  436. The supply phase of a turn handles both the production of resources and
  437. their distribution via supply lines.  Resource production involves a
  438. three-dimensional array indexing unit type, resource type, and terrain
  439. type, but supply lines are measured only by length and resource type.
  440. Supply lines are always interrupted by enemy presence.
  441. .IP \fIn\ resource\ unit\ \fBproduce\fR 5
  442. Set the basic amount of each resource produced by each unit in one turn.
  443. .IP \fIn\ terrain\ unit\ \fBproductivity\fR 5
  444. Set the percentage productivity of a unit on a type of terrain.
  445. This is multiplied with the basic production rate to get actual
  446. production, so productivity of \fB0\fP completely disables production on
  447. that terrain type, and productivity of \fB100\fP is yields the maximum rate
  448. specified by \fBproduce\fP.
  449. .IP \fIn\ resource\ unit\ \fBstorage\fR 5
  450. Set the unit's capacity to carry each sort of resource.
  451. Amount carried does not affect unit's performance.
  452. When the value is \fB0\fP, displays for that type of unit will not mention
  453. this resource type at all.
  454. .IP \fIn\ resource\ unit\ \fBconsume\fR 5
  455. Set the amount of resources consumed by the unit in a turn, even if it
  456. doesn't move or do anything else.  This includes riding as a passenger.
  457. This only comes into play if the unit has used less than its base
  458. consumption while moving.  In other words, the total supply usage for
  459. one unit in one turn is max(#moves * to-move, consume).
  460. If the unit runs out of a resource that it must consume,
  461. it dies due to starvation.
  462. .IP \fIn\ resource\ unit\ \fBin-length\fR 5
  463. .IP \fIn\ resource\ unit\ \fBout-length\fR 5
  464. These two are used together to determine the length (in hexes) of supply lines
  465. between units.  The given type of resource can only be transferred from
  466. unit type A to unit type B if the distance is less than the minimum of
  467. the in-length of B and the out-length of A.
  468. For instance, the in-length
  469. for a fighter's fuel might be 3 hexes, while the out-length of fuel from
  470. a city is 4 hexes.  If the fighter's out-length is 0, then it will be
  471. constantly supplied with fuel when within 3 hexes of a city, but will never
  472. transfer any fuel to the city unless it actually lands there.
  473. An in- or out-length of \fB0\fP
  474. means that the two units must be in the same hex,
  475. while a negative length disables the automatic transfer completely.
  476. Long out-length
  477. lines should be used sparingly, since the algorithm uses the out-length to
  478. define the radius of search for units to be resupplied.  Supply lines are
  479. not affected by terrain at present.
  480. .IP \fIn%\ unit\ \fBsurvival\fR 5
  481. Chance that a unit type can survive on no supplies.  The test is made once
  482. per turn.
  483. .IP \fIstring\ unit\ \fBstarve-message\fR 5
  484. Set what to say when unit has no more of some supply to consume.
  485. Defaults to \fB"runs out of supplies and dies"\fP.
  486. .LP
  487. The movement phase is the main part of a turn in \fIxconq\fP, and the only part
  488. involving interaction with players.  All combat happens during the movement
  489. phase.
  490. .IP \fIn\ unit\ \fBspeed\fR 5
  491. Set the maximum theoretical speed of a unit, in hexes/turn.
  492. If the unit cannot move on any sort of terrain, it will never be prompted
  493. about - thus every period should define at least one type of moving unit.
  494. .IP \fIn\ terrain\ unit\ \fBmoves\fR 5
  495. Set extra moves used up on each type of terrain. \fB0\fP indicates no
  496. decrease from theoretical max, \fB2\fP indicates a move into that type
  497. of terrain uses up 3 moves instead of 1, and \fB-1\fP indicates that
  498. movement on that type of terrain is not possible.
  499. Defaults to \fB-1\fP.
  500. .IP \fIn.01%\ terrain\ unit\ \fBrandom-move\fR 5
  501. Set the randomness of movement of a unit on the terrain.  This is different
  502. from disaster and attrition, since it is not always fatal, and happens only
  503. during attempts to move.  However, collisions with other units or with
  504. impassable terrain, due to random moves, are always fatal.
  505. .IP \fIbool\ unit\ \fBfree-move\fR 5
  506. Set whether the unit can move even if there is insufficient movement
  507. allowance remaining in this turn.  Defaults to \fBtrue\fP.
  508. (Most board wargames make this false - if you don't have enough movement
  509. points to meet the entry requirement for a hex, that's too bad.)
  510. Can be useful to make "double movement phases", if
  511. attack time is equal to movement allowance; a unit can only attack units
  512. that it is adjacent to at the start of the movement phase.
  513. .IP \fIbool\ unit\ \fBone-move\fR 5
  514. Set whether the unit can make exactly one move before dying (appropriate
  515. for rockets and other automatic equipment). [NIY]
  516. .IP \fIbool\ unit\ \fBjump-move\fR 5
  517. Set whether a unit can jump over another unit to get somewhere. [NIY]
  518. .IP \fIn\ resource\ unit\ \fBto-move\fR 5
  519. Set the amount of resource used by a unit to move one hex.
  520. The amount taken is independent of the terrain in the hex.
  521. If the unit is out of any movement resource, it is immobilized
  522. until it gets more.
  523. .LP
  524. Transportation-related parameters.  Capacity is measured both by number
  525. and volume of occupants.  For instance, if you wanted a transport to carry
  526. up to 8 infantry and/or armor, but no more than 4 armor units, then capacity
  527. for infantry should be 8 and capacity for armor 4, the volumes for each 
  528. should be 1, while the transport hold-volume should be 8.
  529. .IP \fIn\ unit2\ unit\ \fBcapacity\fR 5
  530. Set the basic carrying capability of a transport type \fIunit\fP
  531. for its occupants of type \fIunit2\fP.
  532. .IP \fIn\ unit\ \fBhold-volume\fR 5
  533. Set the volume capacity of a transport.  Volume measure is quite arbitrary,
  534. and is used only
  535. for comparison.
  536. The default value of \fB0\fP implies infinite capacity, volume-wise.
  537. .IP \fIn\ unit\ \fBvolume\fR 5
  538. Set the volume of a unit.  The volume of a unit may be smaller than its
  539. hold-volume, the code will not care about this.
  540. .IP \fIn\ unit2\ unit\ \fBenter-time\fR 5
  541. Number of moves needed to enter a transport.  This is a time measure;
  542. extra supplies are not used up.
  543. .IP \fIn\ unit2\ unit\ \fBleave-time\fR 5
  544. Number of moves needed to leave a transport; similar to \fBenter-time\fP.
  545. .IP \fIn%\ unit2\ unit\ \fBalter-mobility\fR 5
  546. Set the effect of an occupant on the transport's speed as a ratio of the
  547. transport's usual speed.  Defaults to \fB100\fP;  smaller values slow the
  548. transport, and \fB0\fP prevents it from moving entirely.  To simplify the code,
  549. only the effect of one (randomly chosen) type of occupant has this effect.
  550. If a transport has two types of
  551. occupants each of which alter its speed differently, the resulting transport
  552. speed will be unpredictable.
  553. The total slowdown is multiplied by the number of occupants of all types.
  554. .LP
  555. Seeing is an important part of \fIxconq\fP, and needs parameters to accommodate
  556. submarines, radar installations, and Indians hiding in the woods.
  557. The visibility of a unit and the intensity of viewing are computed separately,
  558. and compared to get the final decision on seeing something.  This doesn't
  559. allow for much differential between two types of units viewing a third,
  560. but that's life.  For units seeing things at a distance, the chances are
  561. interpolated linearly, from the best conditions (adjacent hex) to worst
  562. (maximum range).
  563. .IP \fIbool\ \fBall-seen\fR 5
  564. If true, then all sides see all of each other's units.  If secrecy unneeded
  565. (as in a board game), this will speed up the display process somewhat.
  566. .IP \fIn%\ unit\ \fBsee-best\fR 5
  567. Set the basic chance of one unit seeing any other,
  568. under best possible conditions.  Defaults to \fB100\fP.
  569. .IP \fIn\ unit\ \fBsee-range\fR 5
  570. Set the maximum distance in hexes at which the unit can see anything.
  571. Defaults to \fB1\fP (adjacent hexes only).
  572. .IP \fIn%\ unit\ \fBsee-worst\fR 5
  573. Set the chance of seeing a unit at the maximum range.
  574. Defaults to \fB100\fP.
  575. .IP \fIn\ unit\ \fBvisibility\fR 5
  576. Set the basic chance of a unit to be seen.
  577. Crippled unit is more visible, in proportion to hp loss.
  578. Defaults to \fB100\fP.
  579. .IP \fIn%\ terrain\ unit\ \fBconceal\fR 5
  580. Set the percent effect of terrain on seeing the unit.  This is subtracted
  581. from the basic chance, since it is a "concealment factor".
  582. .IP \fIbool\ unit\ \fBalways-seen\fR 5
  583. Declare the unit to be of a type that is always seen and up-to-date.
  584. This applies only to units whose underlying hexes have been seen.
  585. This is useful for units like towns,
  586. which are unlikely to disappear secretly.
  587. .LP
  588. Combat is part of movement, and has its own large set of parameters.
  589. The basic plan of combat is for attackers and defenders to hit each other,
  590. then attackers to attempt to capture.
  591. Success of a hit attempt depends on a number of attributes, including
  592. chances, terrain, and the availability of the correct sort of ammo.
  593. .IP \fIbool\ unit\ \fBmulti-part\fR 5
  594. Set a unit to be treated as an aggregate of smaller identical units.
  595. Affects various things. [NIY]
  596. .IP \fIn\ unit\ \fBhp\fR 5
  597. Set the maximum number of hit points for each part of a unit.
  598. Defaults to \fB1\fP, may never be set any lower.
  599. .IP \fIn\ unit\ \fBcrippled\fR 5
  600. Set the hit point level below which the unit is considered to be crippled.
  601. Below this level, repair and construction ceases, supply production is
  602. reduced, maximum speed starts to decrease,
  603. and the bridging capability is disabled.
  604. .IP \fIn%\ unit2\ unit\ \fBhit\fR 5
  605. Base chance of a single attack by the type \fIunit\fP
  606. hitting the defender \fIunit2\fP, assuming the resources are available.
  607. If chance to hit is \fB0\fP, attacker cannot attack or defend itself.
  608. .IP \fIn%\ terrain\ unit\ \fBdefense\fR 5
  609. Set the decreased chance of hitting if the defending type
  610. \fIunit\fP is in that terrain type.
  611. Percentage is subtracted from base chance.
  612. .IP \fIn%\ \fBneutrality\fR 5
  613. Set the change in defense for neutral units.
  614. This is subtracted from chances to hit and capture, but the \fIn%\fP
  615. can be negative, which would make it harder to hit/capture.
  616. .IP \fIn\ unit2\ unit\ \fBdamage\fR 5
  617. Number of hit points that the defender \fIunit2\fP loses when hit by
  618. its attacker \fIunit\fP.
  619. .IP \fIn\ \fBnuke-hit\fR 5
  620. Minimum damage for a hit to qualify as a nuclear blast and be displayed
  621. appropriately.  Default value is \fB50\fP.
  622. .IP \fIbool\ unit\ \fBself-destruct\fR 5
  623. Declare that unit self-destructs when it attacks.  This eliminates some
  624. weird messages and hit chances.
  625. .IP \fIbool\ \fBcounterattack\fR 5
  626. When true, combat is two-way; the initiator of an attack is also hit by
  627. a counterattack.  Otherwise, the defender must wait to get its revenge.
  628. Defaults to \fBtrue\fP.
  629. .IP \fIbool\ unit\ \fBcan-counter\fR 5
  630. Like \fBcounterattack\fP, but applies only to particular unit types
  631. being attacked.
  632. Defaults to \fBtrue\fP.
  633. .IP \fIn%\ unit2\ unit\ \fBcapture\fR 5
  634. Set the base chance of the type \fIunit\fP capturing the defender
  635. type \fIunit2\fP.  This is conditional
  636. on both attacker and defender surviving initial hits, and is modified
  637. by morale and quality of both sides.
  638. .IP \fIbool\ unit2\ unit\ \fBbridge\fR 5
  639. True if the unit type \fIunit2\fP can be captured by another unit
  640. \fIunit\fP, even across
  641. impassable terrain.
  642. .IP \fIn%\ unit\ \fBchanges-side\fR 5
  643. Set chance that the given unit will change sides if captured.
  644. This is appropriate for units that are primarily hardware or
  645. otherwise indifferent to their fate.  Units that are captured and
  646. do not change sides become prisoners (prisoners are not implemented yet).
  647. .IP \fIn\ unit2\ unit\ \fBguard\fR 5
  648. Set the number of unit hit points required to garrison or guard a captured
  649. type \fIunit2\fP, whether or not the captured unit has changed sides
  650. (at present, it always does).
  651. The hit point loss is permanent.
  652. .IP \fIn%\ unit\ \fBretreat\fR 5
  653. Set the base chance that a unit will retreat rather than be hit.
  654. This choice depends on ability to move into an adjacent hex and on
  655. morale, quality, and fatigue.
  656. .IP \fIn\ resource\ unit\ \fBhits-with\fR 5
  657. Set the amounts of each resource used as ammo by the unit.
  658. .IP \fIn\ resource\ unit\ \fBhit-by\fR 5
  659. Set the amounts of each resource necessary to score a hit on the unit.
  660. This is correlated with the previous parameter to decide if right sort
  661. of ammo is available for an attack.
  662. .IP \fIn\ unit2\ unit\ \fBprotect\fR 5
  663. Set the level of protection that \fIunit\fP offers to \fIunit2\fP.
  664. Transports protect their occupants by only letting a percentage of
  665. hits get through.  Occupants protect their transports by reducing the
  666. chance of a hit and increasing chance of a counterattack.
  667. (The default of \fB0\fP implies terrible carnage if a full transport is hit.)
  668. .IP \fIn\ unit\ \fBcombat-time\fR 5
  669. Set the extra number of moves used by an attack.
  670. .IP \fIstring\ unit\ \fBdestroy-message\fR 5
  671. Set what to say when a unit is killed in combat,
  672. as an active verb for what the destroying unit has done to its victim.
  673. Defaults to \fB"destroys"\fP.
  674. .LP
  675. General characteristics are not really classifiable anywhere else.
  676. .IP \fIn\ unit\ \fBterritory\fR 5
  677. Set the territorial value of a unit.  Primarily used by machine players
  678. and win/lose conditions.
  679. .IP \fIn\ unit\ \fBmax-quality\fR 5
  680. Set the maximum quality achievable by a unit.
  681. .IP \fIn%\ unit\ \fBveteran\fR 5
  682. Set the effect of one point of quality on hit and capture chances.
  683. .IP \fIn\ unit\ \fBmax-morale\fR 5
  684. Set the maximum morale to which a unit can rise.
  685. .IP \fIn%\ unit\ \fBcontrol\fR 5
  686. Set the chance of a unit obeying its orders.  Defaults to \fB100\fP.
  687. When the unit does not obey orders, it makes a decision using the machine
  688. players' algorithm.
  689. .IP \fIbool\ unit\ \fBcan-disband\fR 5
  690. Set whether a 'D' disband command can be used to get rid of a unit.
  691. It should not be possible to disband a city, for instance, to eliminate
  692. it as a strategic target.  Note that the default of \fB0\fP effectively
  693. disables the disbanding command entirely.
  694. .IP \fIn%\ \fBefficiency\fR 5
  695. Units disbanded in a transport can have the resources used to build them
  696. reclaimed - this parameter sets the percentage that is actually obtained.
  697. .IP \fIbool\ unit\ \fBneutral\fR 5
  698. Set to \fBtrue\fP if unit can exist as a neutral.
  699. If \fBfalse\fP, then anything that
  700. would cause the unit to become neutral (revolt, surrender of owner)
  701. has the effect of removing it instead.  Defaults to \fBfalse\fP.
  702. .LP
  703. Miscellaneous words.
  704. .IP \fIn\ \fBhostility\fR 5
  705. Set the level of hostility exhibited by a population toward a unit
  706. from some other side. [NIY]
  707. .IP \fBbegin{notes}\fR 5
  708. Declare the beginning of the designer's notes.  This word kicks in a
  709. special reader that absorbs all lines until it sees the line
  710. "\fBend{notes}\fP".  The intervening lines are saved as period notes and
  711. listed out in \fB"parms.xconq"\fP.
  712. The notes should rationalize the design and discuss features
  713. of special interest to the player.
  714. .IP \fBend\fR 5
  715. Marks the end of the period description.
  716. .LP
  717. Nearly all the elementary programming errors are checked, such as stack
  718. over/underflow, and
  719. as many of the period parameters as possible will be checked, although
  720. there is plenty of room for subtle loopholes.  You should think carefully
  721. about the consequences of each parameter, being particularly sensitive to
  722. degenerate winning strategies.  Most common are units that are too powerful,
  723. or that are built so quickly that they overwhelm any opposition.  The
  724. players should always be a little "hungry"; not able to get quite as much
  725. of units or resources as they would really like.
  726. .LP
  727. Although there are many interesting possibilities inherent in this
  728. period description language, you should avoid making the period too
  729. complex to be humanly playable.  The compiled form of the period description
  730. can involve over 16,000 individually settable numbers, each with an expected
  731. range of perhaps 100 distinct values.  It is clearly possible to spend many
  732. years exploring a single set of these numbers.  For more playable and
  733. enjoyable games, either pick a single aspect to treat in detail, or else
  734. do all aspects in a simplified way.  Aspects could include exploration,
  735. logistics, naval operations, "shoot-em-up", renditions of familiar board
  736. games or even some team sports (rugby for instance).  Another thing to
  737. keep in mind is that the introduction of a new type may have far-reaching
  738. consequences - a new unit type will need its interactions with \fIall\fP
  739. other unit types defined.  One approach is to introduce a new type as a
  740. slight modification of an existing type, then to share most of the
  741. definitions.
  742. .LP
  743. Something else to keep in mind is that the period parameters have been
  744. chosen for their ability to combine in interesting ways, rather than for
  745. obvious usefulness.  For example, past startup, the production rate for
  746. units is constant and unending.  But suppose you want to put a limit on
  747. the numbers of that type of unit?  One way is to define a resource that
  748. is essential for construction of that type, let the builder have an initial
  749. supply, but provide no way to get more of that resource.  When it runs out,
  750. no more units!  Another trick is to motivate an activity by making it a
  751. prerequisite to the basic builtin goal of defeating the other player.
  752. The age of discovery worked this way.  The kings of that time weren't
  753. interested in new lands per se;  they wanted exploitable possessions that
  754. could be used to get gold to buy armies big enough to defeat their neighbors.
  755. The period language could describe this situation almost exactly, by making
  756. gold a resource obtainable only by the capture of neutral mines thinly
  757. scattered over the map.  Be inventive!
  758. Studying the predefined periods should reveal a number of tricks.
  759. .LP
  760. Completely new periods usually have a number of bugs.  The tools are
  761. rather limited, but then most of the bugs are fairly obvious.
  762. The \fBprint\fP word is useful for examining the stack, and a number of
  763. errors (such as stack overflow/underflow) have messages.  Finding out
  764. where the problem occurred requires the use of the \fIxconq\fP debugging
  765. flag \fB-D\fP, which has the effect of listing out each period token as
  766. it is read.  This can also be used with the period compiler, which starts
  767. up faster; invoke it as \fB"per2c -D <newperiod.per"\fP.  The most serious
  768. problems with periods are play balance issues.  Some can be found out by
  769. watching a machine player, since its decisions are based on perceived values
  770. of the units.  The most subtle bugs can only be uncovered by extensive play
  771. interspersed with judicious alteration of parameters.  I find it useful to
  772. play for a while, then go over all the period parameters, thus avoiding
  773. tweaking one parameter only to find that it results in another being
  774. inconsistent.  Parameters interact in many ways - you should keep this in
  775. mind when experimenting.
  776.